********************************************************************************
* Replication Material for: Mindset to Gain? Framing Effects, Need for Chaos, and the Limits of "Burning It All Down"*

*Authors: Fitz, Erin B., Stecula, Dominik A., Hitt, Matthew P., and Saunders, Kyle L.

*Accepted for publication in Behavioural Public Policy
*September 2025

*Note: Code for the main analysis begins on line 887

********************************************************************************
*********************************** Study 1 ************************************
********************************************************************************

*To begin this analysis, first download the following Stata Data file, found in the uploaded supporting materials: "/Chaos Study 1.dta"

*Module to calculate summated scale/indexed variables
// ssc install sumscale
	
********************************************************************************
******************************* Variable Coding ******************************** 
********************************************************************************

// destring, replace 

****************************** Attention Check *********************************

// label define colorcheck ///
// 0 "Incorrect" 1 "Correct" 
// label values colorcheck colorcheck

******************************** Demographics **********************************

*Education
// gen educationx = education
// recode educationx (6=5) (5=6)
// label var educationx ///
// "Education"
// label define educationx ///
// 1 "1 Did not complete HS" 2 "2 HS or GED" 3 "3 Some college" 4 "4 College graduate" 5 "5 Some postgraduate" 6 "Postgraduate degree"
// label values educationx educationx 
// recast double educationx

// gen education01 = (educationx-1)/5
// label var education01 ///
// "Education"
// recast double education01

*Income: omits "prefer not to say"
// gen incomex = income 
// replace incomex = . if income == 10
// label var incomex ///
// "Income"
// label define incomex ///
// 1 "1 Under 20,000" 2 "2 20,000-39,999" 3 "3 40,000-59,000" 4 "4 60,000-79,999" 5 "5 80,000-99,999" 6 "6 100,000-124,999" 7 "7 125,000-149,999" 8 "8 150,000-199,999" 9 "9 200,000 and over" 
// label values incomex incomex 
// recast double incomex

// gen income01 = (incomex-1)/8
// label var income01 ///
// "Income"
// recast double income01

*Gender: Female
// gen gender01 = gender
// recode gender01 (1=0) (2=1) (3=0) 
// label var gender01 ///
// "Gender"
// label define gender01 ///
// 0 "0 Not female" 1 "1 female"
// label values gender01 gender01 
// recast double gender01 

*Age
// gen agex = age_1
// replace agex = . if age_1 <18
// label var agex ///
// "Age"
// recast double agex

// gen age01 = (agex-18)/82
// label var age01 ///
// "Age"
// recast double age01

// *Race: White/non-white 
// destring race, generate(racex) ignore(`","')
// gen race01 = racex 
// replace race01 = . if racex == 9
// recode race01 (1=1) (nonmiss=0)
// label var race01 ///
// "Race"
// label define race01 ///
// 0 "0 Non-white" 1 "1 White"
// label values race01 race01 
// recast double race01 

// *Ethnicity: Hispanic or Latino/non-Hispanic or Latino
// gen ethnicity01 = hispanic 
// recode ethnicity01 (2=0)
// label var ethnicity01 ///
// "Ethnicity"
// label define ethnicity01 ///
// 0 "0 Not Hispanic or Latino" 1 "1 Hispanic or Latino" 
// label values ethnicity01 ethnicity01 
// recast double ethnicity01 

// *Religion: reverse coded 
// gen religionx = religion 
// recode religionx (1=5) (2=4) (4=2) (5=1)
// label var religionx ///
// "Religiosity"
// label define religionx ///
// 1 "1 Very inactive" 2 "2 Moderately inactive" 3 "3 Neither active nor inactive" 4 "4 Moderately active" 5 "5 Very active"
// label values religionx religionx 
// recast double religionx 

// gen religion01 = (religionx-1)/4
// label var religion01 ///
// "Religiosity" 
// recast double religion01 

// *Party ID 
// gen pid7x = .
// replace pid7x = 1 if partyid == 2 & strongdem == 1
// replace pid7x = 2 if partyid == 2 & strongdem == 2
// replace pid7x = 3 if partyid == 3 & lean == 1 
// replace pid7x = 4 if partyid == 3 & lean == 3 
// replace pid7x = 5 if partyid == 3 & lean == 2
// replace pid7x = 6 if partyid == 1 & strongrep == 2
// replace pid7x = 7 if partyid == 1 & strongrep == 1
// label var pid7x ///
// "Party ID"
// label define pid7x ///
// 1 "1 Strong Democrat" 2 "2 Not very strong Democrat" 3 "3 Independent-Democrat" 4 "4 Independent" 5 "5 Independent-Republican" 6 "6 Not very strong Republican" 7 "7 Strong Republican" 
// label values pid7x pid7x 
// recast double pid7x 

// gen pid701 = (pid7x-1)/6
// label var pid701 ///
// "Party ID" 
// recast double pid701 

***************************** Political Knowledge ******************************

// sumscale, f1(pk1 pk2 pk3 pk4 pk5 pk6) fdummy
// rename Factor1_dsum polknowx 
// label var polknowx ///
// "Political Knowledge"

// gen polknow01 = (polknowx)/6
// label var polknow01 ///
// "Political Knowledge"
// recast double polknow01 

********************************** Numeracy ************************************
//
// *Numeracy 1 (Correct Answer: 500 times) 
// tab numeracy1
// gen n1x = numeracy1 
// replace n1x = "0" if numeracy1 == "1"
// replace n1x = "1" if numeracy1 == ",5"
// replace n1x = "1" if numeracy1 == ".50"
// replace n1x = "1" if numeracy1 == "1 in 2"
// replace n1x = "1" if numeracy1 == "1/2"
// replace n1x = "1" if numeracy1 == "50 percent"
// replace n1x = "1" if numeracy1 == "50 percent "
// replace n1x = "1" if numeracy1 == "50%"
// replace n1x = "1" if numeracy1 == "50% "
// replace n1x = "1" if numeracy1 == "50% of the time"
// replace n1x = "1" if numeracy1 == "50% of the time, barring small random.."
// replace n1x = "1" if numeracy1 == "50% of the time."
// replace n1x = "1" if numeracy1 == "50%."
// replace n1x = "1" if numeracy1 == "50-50"
// replace n1x = "1" if numeracy1 == "50-50 chance"
// replace n1x = "1" if numeracy1 == "500"
// replace n1x = "1" if numeracy1 == "500 "
// replace n1x = "1" if numeracy1 == "500 but that is unlikely"
// replace n1x = "1" if numeracy1 == "500 times"
// replace n1x = "1" if numeracy1 == "500t"
// replace n1x = "1" if numeracy1 == "50:50"
// replace n1x = "1" if numeracy1 == "About half"
// replace n1x = "1" if numeracy1 == "About half "
// replace n1x = "1" if numeracy1 == "Approx. 50% of the time"
// replace n1x = "1" if numeracy1 == "Around 500 times"
// replace n1x = "1" if numeracy1 == "At least 500"
// replace n1x = "1" if numeracy1 == "Half"
// replace n1x = "1" if numeracy1 == "Half "
// replace n1x = "1" if numeracy1 == "Half exactly"
// replace n1x = "1" if numeracy1 == "Half of the time"
// replace n1x = "1" if numeracy1 == "Half of the time avarage"
// replace n1x = "1" if numeracy1 == "Half the  time"
// replace n1x = "1" if numeracy1 == "Half the time"
// replace n1x = "1" if numeracy1 == "Half the time."
// replace n1x = "1" if numeracy1 == "Half the time. 500 times."
// replace n1x = "1" if numeracy1 == "Yes 50/50"
// replace n1x = "1" if numeracy1 == "about 50% of the time + or - 20%"
// replace n1x = "1" if numeracy1 == "about 500"
// replace n1x = "1" if numeracy1 == "about half the time"
// replace n1x = "1" if numeracy1 == "approximately 500 times"
// replace n1x = "1" if numeracy1 == "half" 
// replace n1x = "1" if numeracy1 == "half the time"
// replace n1x = "1" if numeracy1 == "half the time "
// replace n1x = "1" if numeracy1 == "half, 500 times"
// replace n1x = "1" if numeracy1 == "roughly 50%"

// destring n1x, generate(n1) force
// recode n1 (1=1) (nonmiss = 0) (miss = 0)
// recast double n1

// *Numeracy 2 (Correct Answer: 10 persons out of 1000)
// tab numeracy2
// gen n2x = numeracy2 
// replace n2x = "1" if numeracy2 == " 10"
// replace n2x = "1" if numeracy2 == "10"
// replace n2x = "1" if numeracy2 == "10 "
// replace n2x = "1" if numeracy2 == "10 people"
// replace n2x = "1" if numeracy2 == "10 people "
// replace n2x = "1" if numeracy2 == "10 people would win a $10 prize."
// replace n2x = "1" if numeracy2 == "10 people, if I can still do simple math"
// replace n2x = "1" if numeracy2 == "10 persons"
// replace n2x = "1" if numeracy2 == "10."
// replace n2x = "1" if numeracy2 == "10.."
// replace n2x = "1" if numeracy2 == "10.0"
// replace n2x = "1" if numeracy2 == "10.00"
// replace n2x = "1" if numeracy2 == "10.000"
// replace n2x = "1" if numeracy2 == "10?" 
// replace n2x = "1" if numeracy2 == "1o"
// replace n2x = "1" if numeracy2 == "Around ten"
// replace n2x = "1" if numeracy2 == "Ten"
// replace n2x = "1" if numeracy2 == "Theoretically 10 people"

// destring n2x, generate(n2) force
// recode n2 (1=1) (nonmiss = 0) (miss = 0)
// recast double n2

// *Numeracy 3 (Correct Answer: 0.1%)
// tab numeracy3 
// gen n3x = numeracy3 
// replace n3x = "0" if numeracy3 == " 0.10%"
// replace n3x = "0" if numeracy3 == "1"
// replace n3x = "1" if numeracy3 == "0.10%"
// replace n3x = "1" if numeracy3 == "%.1"
// replace n3x = "1" if numeracy3 == "%0.1"
// replace n3x = "1" if numeracy3 == "%0.10"
// replace n3x = "1" if numeracy3 == ",0.1"
// replace n3x = "1" if numeracy3 == ". 1"
// replace n3x = "1" if numeracy3 == "..1"
// replace n3x = "1" if numeracy3 == "..1%"
// replace n3x = "1" if numeracy3 == ".1"
// replace n3x = "1" if numeracy3 == ".1 %"
// replace n3x = "1" if numeracy3 == ".1 per cent"
// replace n3x = "1" if numeracy3 == ".1 percent"
// replace n3x = "1" if numeracy3 == ".1 percent "
// replace n3x = "1" if numeracy3 == ".1%"
// replace n3x = "1" if numeracy3 == ".10"
// replace n3x = "1" if numeracy3 == ".10 %"
// replace n3x = "1" if numeracy3 == ".10%"
// replace n3x = "1" if numeracy3 == "0,1"
// replace n3x = "1" if numeracy3 == "0.1"
// replace n3x = "1" if numeracy3 == "0.1 "
// replace n3x = "1" if numeracy3 == "0.1 %"
// replace n3x = "1" if numeracy3 == "0.1 percent" 
// replace n3x = "1" if numeracy3 == "0.1%"
// replace n3x = "1" if numeracy3 == "0.10%"
// replace n3x = "1" if numeracy3 == "0.10% chance of winning the car."
// replace n3x = "1" if numeracy3 == "00.1"
// replace n3x = "1" if numeracy3 == "000,1"
// replace n3x = "1" if numeracy3 == "0.1%"
// replace n3x = "1" if numeracy3 == "1/10 of 1%"
// replace n3x = "1" if numeracy3 == "1/10%"
// replace n3x = "1" if numeracy3 == "one tenth on one percent"
//
// destring n3x, generate(n3) force
// recode n3 (1=1) (nonmiss = 0) (miss = 0)
// recast double n3

// *Numeracy 4
// gen num4x = numeracy4 
// recode num4x (1=0) (2=0) (3=1) (miss=0)
// recast double num4x

// gen n4 = num4x
// recast double n4 

// *Numeracy 5
// gen num5x = numeracy5 
// recode num5x (1=0) (2=1) (3=0) (miss=0)
// recast double num5x

// gen n5 = num5x 
// recast double n5

// *Numeracy 6 (Correct Answer: 2%)
// tab numeracy6
// gen n6x = numeracy6
// replace n6x = "0" if numeracy6 == "1"
// replace n6x = "1" if numeracy6 == "%2"
// replace n6x = "1" if numeracy6 == "2"
// replace n6x = "1" if numeracy6 == "2 "
// replace n6x = "1" if numeracy6 == "2 %"
// replace n6x = "1" if numeracy6 == "2 % "
// replace n6x = "1" if numeracy6 == "2 % in ten years"
// replace n6x = "1" if numeracy6 == "2 % in ten years "
// replace n6x = "1" if numeracy6 == "2 0/0 in 10 yrs" 
// replace n6x = "1" if numeracy6 == "2 PER CENT"
// replace n6x = "1" if numeracy6 == "2 every 10"
// replace n6x = "1" if numeracy6 == "2 in 10"
// replace n6x = "1" if numeracy6 == "2 in ten"
// replace n6x = "1" if numeracy6 == "2 in ten years"
// replace n6x = "1" if numeracy6 == "2 in ten years "
// replace n6x = "1" if numeracy6 == "2 per cent"
// replace n6x = "1" if numeracy6 == "2 per cent "
// replace n6x = "1" if numeracy6 == "2 per cent in 10 years"
// replace n6x = "1" if numeracy6 == "2 percent" 
// replace n6x = "1" if numeracy6 == "2 percent "
// replace n6x = "1" if numeracy6 == "2 percent  in 10yrs2"
// replace n6x = "1" if numeracy6 == "2 percent chance"
// replace n6x = "1" if numeracy6 == "2 percent in 10 years" 
// replace n6x = "1" if numeracy6 == "2 percent in 10 years "
// replace n6x = "1" if numeracy6 == "2$"
// replace n6x = "1" if numeracy6 == "2%"
// replace n6x = "1" if numeracy6 == "2% "
// replace n6x = "1" if numeracy6 == "2%  in 10 years"
// replace n6x = "1" if numeracy6 == "2% 2x1=2"
// replace n6x = "1" if numeracy6 == "2% 8n ten years"
// replace n6x = "1" if numeracy6 == "2% IN TEN YEARS"
// replace n6x = "1" if numeracy6 == "2% in 10"
// replace n6x = "1" if numeracy6 == "2% in 10 Years"
// replace n6x = "1" if numeracy6 == "2% in 10 year"
// replace n6x = "1" if numeracy6 == "2% in 10 years"
// replace n6x = "1" if numeracy6 == "2% in 10 years "
// replace n6x = "1" if numeracy6 == "2% in 10 years."
// replace n6x = "1" if numeracy6 == "2% in 10 yrs"
// replace n6x = "1" if numeracy6 == "2% in 10 yrs."
// replace n6x = "1" if numeracy6 == "2% in 10years" 
// replace n6x = "1" if numeracy6 == "2% in ten"
// replace n6x = "1" if numeracy6 == "2% in ten years"
// replace n6x = "1" if numeracy6 == "2% in ten years "
// replace n6x = "1" if numeracy6 == "2% in ten years 2"
// replace n6x = "1" if numeracy6 == "2% in ten years."
// replace n6x = "1" if numeracy6 == "2% on ten years"
// replace n6x = "1" if numeracy6 == "2% risk in ten years"
// replace n6x = "1" if numeracy6 == "2% ten years"
// replace n6x = "1" if numeracy6 == "2% ... ?"
// replace n6x = "1" if numeracy6 == "2%."
// replace n6x = "1" if numeracy6 == "2%1 in"
// replace n6x = "1" if numeracy6 == "2%2"
// replace n6x = "1" if numeracy6 == "2%2%"
// replace n6x = "1" if numeracy6 == "2%in ten years"
// replace n6x = "1" if numeracy6 == "2,percent"
// replace n6x = "1" if numeracy6 == "2.%"
// replace n6x = "1" if numeracy6 == "2percent"
// replace n6x = "1" if numeracy6 == "2percent "
// replace n6x = "1" if numeracy6 == "B is 2%"

// destring n6x, generate(n6) force
// recode n6 (1=1) (nonmiss = 0) (miss = 0)
// recast double n6 

// *Numeracy 7 (Correct Answer: 2 out of 100)
// tab numeracy7
// gen n7x = numeracy7
// replace n7x = "0" if numeracy7 == "1"
// replace n7x = "1" if numeracy7 == " 2"
// replace n7x = "1" if numeracy7 == "2"
// replace n7x = "1" if numeracy7 == "2 "
// replace n7x = "1" if numeracy7 == "2  in 100"
// replace n7x = "1" if numeracy7 == "2  in 100 in ten years"
// replace n7x = "1" if numeracy7 == "2 /100"
// replace n7x = "1" if numeracy7 == "2 IN 100"
// replace n7x = "1" if numeracy7 == "2 IN 100 IN TEN YEARS10"
// replace n7x = "1" if numeracy7 == "2 IN 100 IN TEN YRS."
// replace n7x = "1" if numeracy7 == "2 en 100"
// replace n7x = "1" if numeracy7 == "2 in !00"
// replace n7x = "1" if numeracy7 == "2 in 100"
// replace n7x = "1" if numeracy7 == "2 in 100 10 years"
// replace n7x = "1" if numeracy7 == "2 in 100 in 10 years"
// replace n7x = "1" if numeracy7 == "2 in 100 in 10 years "
// replace n7x = "1" if numeracy7 == "2 in 100 in 10 years."
// replace n7x = "1" if numeracy7 == "2 in 100 in 10 yers"
// replace n7x = "1" if numeracy7 == "2 in 100 in 10 yrs"
// replace n7x = "1" if numeracy7 == "2 in 100 in ten year"
// replace n7x = "1" if numeracy7 == "2 in 100 in ten years"
// replace n7x = "1" if numeracy7 == "2 in 100 in ten years "
// replace n7x = "1" if numeracy7 == "2 in 100 or 2%"
// replace n7x = "1" if numeracy7 == "2 in 100????"
// replace n7x = "1" if numeracy7 == "2 in a 100 in 10 yrs."
// replace n7x = "1" if numeracy7 == "2 in a hundred"
// replace n7x = "1" if numeracy7 == "2 in a100"
// replace n7x = "1" if numeracy7 == "2 in 10 years" 
// replace n7x = "1" if numeracy7 == "2 in100"
// replace n7x = "1" if numeracy7 == "2 in100 in 10 years"
// replace n7x = "1" if numeracy7 == "2 in100 in ten years"
// replace n7x = "1" if numeracy7 == "2 in100 in ten years1"
// replace n7x = "1" if numeracy7 == "2 inn 100"
// replace n7x = "1" if numeracy7 == "2 of 100 in 10 yrs"
// replace n7x = "1" if numeracy7 == "2 out of 100"
// replace n7x = "1" if numeracy7 == "2-100"
// replace n7x = "1" if numeracy7 == "2/100"
// replace n7x = "1" if numeracy7 == "2in 100"
// replace n7x = "1" if numeracy7 == "2in100"

// destring n7x, generate(n7) force
// recode n7 (1=1) (nonmiss = 0) (miss = 0)
// recast double n7

// *Numeracy 8a (Correct Answer: 10 out of 100)
// tab numeracy8a
// gen n8ax = numeracy8a
// replace n8ax = "0" if numeracy8a == "1"
// replace n8ax = "1" if numeracy8a == "10"
// replace n8ax = "1" if numeracy8a == "10 "
// replace n8ax = "1" if numeracy8a == "10 de 100"
// replace n8ax = "1" if numeracy8a == "10 in  100"
// replace n8ax = "1" if numeracy8a == "10 in 100"
// replace n8ax = "1" if numeracy8a == "10 out of 100"
// replace n8ax = "1" if numeracy8a == "10 people"
// replace n8ax = "1" if numeracy8a == "10 people "
// replace n8ax = "1" if numeracy8a == "10 people infected"
// replace n8ax = "1" if numeracy8a == "10 persons"
// replace n8ax = "1" if numeracy8a == "10 roughly"
// replace n8ax = "1" if numeracy8a == "10."
// replace n8ax = "1" if numeracy8a == "10.000"
// replace n8ax = "1" if numeracy8a == "10/100"
// replace n8ax = "1" if numeracy8a == "Ten"
// replace n8ax = "1" if numeracy8a == "ten"

// destring n8ax, generate(n8a) force
// recode n8a (1=1) (nonmiss = 0) (miss = 0)
// recast double n8a

// *Numeracy 8b (Correct Answer: 100 out of 1000) 
// tab numeracy8b
// gen n8bx = numeracy8b
// replace n8bx = "0" if numeracy8b == "1"
// replace n8bx = "1" if numeracy8b == "100"
// replace n8bx = "1" if numeracy8b == "100 "
// replace n8bx = "1" if numeracy8b == "100 in 1000"
// replace n8bx = "1" if numeracy8b == "100 people"
// replace n8bx = "1" if numeracy8b == "100 people "
// replace n8bx = "1" if numeracy8b == "100 persons"
// replace n8bx = "1" if numeracy8b == "100 roughly"
// replace n8bx = "1" if numeracy8b == "100/1000"

// destring n8bx, generate(n8b) force
// recode n8b (1=1) (nonmiss = 0) (miss = 0)
// recast double n8b

// *Numeracy 9 (Correct Answer: 20%) 
// tab numeracy9
// gen n9x = numeracy9
// replace n9x = "0" if numeracy9 == "1"
// replace n9x = "1" if numeracy9 == "%20"
// replace n9x = "1" if numeracy9 == "20"
// replace n9x = "1" if numeracy9 == "20 "
// replace n9x = "1" if numeracy9 == "20 %"
// replace n9x = "1" if numeracy9 == "20 % chance"
// replace n9x = "1" if numeracy9 == "20 PERCENT"
// replace n9x = "1" if numeracy9 == "20 o/o"
// replace n9x = "1" if numeracy9 == "20 per cent"
// replace n9x = "1" if numeracy9 == "20 percent"
// replace n9x = "1" if numeracy9 == "20 percent "
// replace n9x = "1" if numeracy9 == "20%"
// replace n9x = "1" if numeracy9 == "20% "
// replace n9x = "1" if numeracy9 == "20% chance"
// replace n9x = "1" if numeracy9 == "20% chance of getting the disease."
// replace n9x = "1" if numeracy9 == "20%, r20r"
// replace n9x = "1" if numeracy9 == "20r"

// destring n9x, generate(n9) force
// recode n9 (1=1) (nonmiss = 0) (miss = 0)
// recast double n9

// *Numeracy 10 (Correct Answer: 5 people) 
// tab numeracy10
// gen n10x = numeracy10
// replace n10x = "0" if numeracy10 == "1"
// replace n10x = "1" if numeracy10 == " 5"
// replace n10x = "1" if numeracy10 == "05"
// replace n10x = "1" if numeracy10 == "5"
// replace n10x = "1" if numeracy10 == "5 "
// replace n10x = "1" if numeracy10 == "5 people"
// replace n10x = "1" if numeracy10 == "5 people "
// replace n10x = "1" if numeracy10 == "Five"
// replace n10x = "1" if numeracy10 == "⚅5" 

// destring n10x, generate(n10) force
// recode n10 (1=1) (nonmiss = 0) (miss = 0)
// recast double n10

// *11-Item Numeracy Index 
// sumscale, f1(n1 n2 n3 n4 n5 n6 n7 n8a n8b n9 n10) fdummy
// rename Factor1_dsum numindex
// label var numindex ///
// "Numeracy: Additive Index"
// recast double numindex 

// *Numeracy Median Split
// summarize numindex 
// hist numindex, percent
// tabstat numindex, stat(p50)
// gen numeracysplit = numindex
// replace numeracysplit = 0 if numindex < 7
// replace numeracysplit = 1 if numindex > 7
// replace numeracysplit = 0 if numindex==7
// label var numeracysplit ///
// "Numeracy: High/Low"
// label define numeracysplit ///
// 0 "0 Low numeracy" 1 "1 High numeracy"
// label values numeracysplit numeracysplit
// recast double numeracysplit

********************************** Interest ************************************

// *Following closely: reverse coded 
// gen debt1x = debt1 
// label var debt1x ///
// "Following debt limit debate"
// label define debt1x ///
// 1 "1 Not closely at all" 2 "2 Not very closely" 3 "3 Somewhat closely" 4 "4 Very closely" 5 "5 Extremely closely" 
// label values debt1x debt1x 
// recast double debt1x 

// gen debt101 = (debt1x-1)/4
// label var debt101 ///
// "Following debt limit debate"
// recast double debt101 

// *Understand the debate: reverse coded 
// gen debt2x = debt2
// label var debt2x ///
// "Understand debt limit debate"
// label define debt2x ///
// 1 "1 Not well at all" 2 "2 Not very well" 3 "3 Somewhat well" 4 "4 Very well" 5 "5 Extremely well" 
// label values debt2x debt2x 
// recast double debt2x 

// gen debt201 = (debt2x-1)/4
// label var debt201 ///
// "Understand debt limit debate"
// recast double debt201 

// *General political interest 
// gen interestx = interest 
// recode interestx (8=1)
// label var interestx ///
// "Interest"
// label define interestx ///
// 1 "1 Never" 2 "2 Some of the time" 3 "3 About half the time" 4 "4 Most of the time" 5 "5 Always"
// label values interestx interestx 
// recast double interestx 

// gen interest01 = (interestx-1)/4
// label var interest01 ///
// "Interest"
// recast double interest01
//
// alpha debt101 debt201 interest01, item
//
// factor debt101 debt201 interest01, ipf

// sumscale, f1(debt101 debt201 interest01)
// rename Factor1_average interestdebt 
// label var interestdebt ///
// "Interest in Politics/Debt Ceiling Issue"
// recast double interestdebt 

// ************************************ Trust *************************************

// gen trustgovtx = trustgovt
// label var trustgovtx ///
// "Trust"
// label define trustgovtx ///
// 1 "1 Never" 2 "2 Some of the time" 3 "3 About half the time" 4 "4 Most of the time" 5 "5 Always"
// label values trustgovtx trustgovtx 
// recast double trustgovtx 

// gen trustgovt01 = (trustgovtx-1)/4
// label var trustgovt01 ///
// "Trust"
// recast double trustgovt01

// ****************************** Authoritarianism ********************************

// recode auth3 (0=1) (1=0)

// sumscale, f1(auth1 auth2 auth3 auth4) 
// rename Factor1_average author01 
// label var author01 ///
// "Authoritarianism"
// recast double author01

// ******************************* Need for Chaos *********************************

// factor chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7 chaos8, ipf
// factor chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7, ipf

// sumscale, f1(chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7)
// rename Factor1_average chaos7x
// label var chaos7x ///
// "Need for Chaos 7-Item" 
// recast double chaos7x 

// gen chaos701 = (chaos7x-1)/6
// label var chaos701 ///
// "Need for Chaos 7-Item"
// recast double chaos701 

// ****************************** Need for Closure ********************************
//
// sumscale, f1(closure_1 closure_2 closure_3 closure_4 closure_5 closure_6 closure_7 closure_8 closure_9 closure_10 closure_11 closure_12 closure_13 closure_14 closure_15)
// rename Factor1_average closurex 
// label var closurex ///
// "Need for Closure"
// recast double closurex 
//
// gen closure01 = (closurex-1)/10
// label var closure01 ///
// "Need for Closure"
// recast double closure01 
//
// ************************************ Risk **************************************

// *risk3: reverse coded 
// gen risk3x = risk3
// recode risk3x (1=5) (2=4) (4=2) (5=1)

// *risk4: reverse coded 
// gen risk4x = risk4
// recode risk4x (1=5) (2=4) (4=2) (5=1)

// *risk5: reverse coded 
// gen risk5x = risk5
// recode risk5x (1=5) (2=4) (4=2) (5=1)

// *risk6: reverse coded 
// gen risk6x = risk6
// recode risk6x (1=5) (2=4) (4=2) (5=1)

// *risk7: reverse coded 
// gen risk7x = risk7
// recode risk7x (1=5) (2=4) (4=2) (5=1)

// *5-Item Risk Scale
// alpha risk3x risk4x risk5x risk6x risk7x, item
// guttmanl risk3x risk4x risk5x risk6x risk7x
// factor risk3x risk4x risk5x risk6x risk7x, ipf

// sumscale, f1(risk3x risk4x risk5x risk6x risk7x)
// rename Factor1_average riskx 
// label var riskx ///
// "Risk Orientation"
// recast double riskx 

// gen risk01 = (riskx-1)/4
// label var risk01 ///
// "Risk"
// recast double risk01

// ****************************** Need for Cognition ******************************

// *Reverse coded 
// gen cog1 = cognition_1 
// recode cog1 (1=5) (2=4) (4=2) (5=1)
// label define cog1 ///
// 1 "1 Strongly disagree" 2 "2 Disagree" 3 "3 Neither agree nor disagree" 4 "Agree" 5 "5 Strongly agree"
// label values cog1 cog1 
// recast double cog1

// gen cog2 = cognition_2
// recode cog2 (1=5) (2=4) (4=2) (5=1)
// label define cog2 ///
// 1 "1 Strongly disagree" 2 "2 Disagree" 3 "3 Neither agree nor disagree" 4 "Agree" 5 "5 Strongly agree"
// label values cog2 cog2 
// recast double cog2

// gen cog3 = cognition_3
// recode cog2 (1=5) (2=4) (4=2) (5=1)
// label define cog3 ///
// 5 "5 Strongly disagree" 4 "4 Disagree" 3 "3 Neither agree nor disagree" 2 "2 Agree" 1 "1 Strongly agree"
// label values cog3 cog3 
// recast double cog3

// gen cog4 = cognition_4
// recode cog2 (1=5) (2=4) (4=2) (5=1)
// label define cog4 ///
// 5 "5 Strongly disagree" 4 "4 Disagree" 3 "3 Neither agree nor disagree" 2 "2 Agree" 1 "1 Strongly agree"
// label values cog4 cog4 
// recast double cog4

// gen cog5 = cognition_5
// recode cog5 (1=5) (2=4) (4=2) (5=1)
// label define cog5 ///
// 1 "1 Strongly disagree" 2 "2 Disagree" 3 "3 Neither agree nor disagree" 4 "Agree" 5 "5 Strongly agree"
// label values cog5 cog5 
// recast double cog5

// gen cog6 = cognition_6
// recode cog6 (1=5) (2=4) (4=2) (5=1)
// label define cog6 ///
// 1 "1 Strongly disagree" 2 "2 Disagree" 3 "3 Neither agree nor disagree" 4 "Agree" 5 "5 Strongly agree"
// label values cog6 cog6 
// recast double cog6

// sumscale, f1(cog1 cog2 cog3 cog4 cog5 cog6)
// rename Factor1_average cognitionx 
// label var cognitionx ///
// "Need for Cognition"
// recast double cognitionx

// gen cognition01 = (cognitionx-1)/4
// label var cognition01 ///
// "Need for Cognition"
// recast double cognition01

// *********************************** Big Five ***********************************

// *Extraversion 
// gen extraversion101 = (TIPI_1-1)/6
// label var extraversion101 ///
// "Extraversion"
// recast double extraversion1
//
// gen extraversion2x = TIPI_6
// recode extraversion2x (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) 
// label var extraversion2x ///
// "Extraversion"
// recast double extraversion2x 
//
// gen extraversion201 = (extraversion2x-1)/6
// label var extraversion201 ///
// "Extraversion"
// recast double extraversion201
//
// sumscale, f1(extraversion101 extraversion201)
// rename Factor1_average extra
// label var extra ///
// "Extraversion"
// recast double extra
//
// *Agreeableness 
// gen agreeable1x = TIPI_2
// recode agreeable1x (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) 
// label var agreeable1x ///
// "Agreeableness"
// recast double agreeable1x 
//
// gen agreeable101 = (agreeable1x-1)/6
// label var agreeable101 ///
// "Agreeableness"
// recast double agreeable101
//
// gen agreeable201 = (TIPI_7-1)/6
// label var agreeable201 ///
// "Agreeableness"
// recast double agreeable201
//
// sumscale, f1(agreeable101 agreeable201)
// rename Factor1_average agree
// label var agree ///
// "Agreeableness"
// recast double agree
//
// *Conscientiousness 
// gen conscientious101 = (TIPI_3-1)/6
// label var conscientious101 ///
// "Conscientiousness"
// recast double conscientious101
//
// gen conscientious2x = TIPI_8
// recode conscientious2x (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) 
// label var conscientious2x ///
// "Conscientiousness"
// recast double conscientious2x 
//
// gen conscientious201 = (conscientious2x-1)/6
// label var conscientious201 ///
// "Conscientiousness"
// recast double conscientious201
//
// sumscale, f1(conscientious101 conscientious201)
// rename Factor1_average conscient
// label var conscient ///
// "Conscientiousness" 
// recast double conscient
//
// *Emotional Stability/Neuroticism
// gen emotional1x = TIPI_4
// recode emotional1x (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) 
// label var emotional1x ///
// "Emotional Stability"
// recast double emotional1x 
//
// gen emotional101 = (emotional1x-1)/6
// label var emotional101 ///
// "Emotional Stability"
// recast double emotional101
//
// gen emotional201 = (TIPI_9-1)/6
// label var emotional201 ///
// "Emotional Stability"
// recast double emotional201
//
// sumscale, f1(emotional101 emotional201)
// rename Factor1_average neuro
// label var neuro ///
// "Emotional Stability"
// recast double neuro 
//
// *Openness to Experiences
//
// gen openness101 = (TIPI_5-1)/6
// label var openness101 ///
// "Openness"
// recast double openness101
//
// gen openness2x = TIPI_10
// recode emotional1x (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) 
// label var emotional1x ///
// "Openness"
// recast double emotional1x 
//
// gen openness201 = (openness2x-1)/6
// label var openness201 ///
// "Openness"
// recast double openness201
//
// sumscale, f1(openness101 openness201)
// rename Factor1_average open
// label var open ///
// "Openness"
// recast double open 

********************************** Experiment **********************************

*Gain and Loss frames are coded such that 1 indicates the modal response according to Prospect Theory (i.e., risk-averse re: gains; risk-seeking re: losses); "Risky" indicates whether one preferred the risky Deal B, regardless of frame.

// *Gain Frame
// gen gain01 = gain
// recode gain01 (2=0)
// label var gain01 ///
// "Gain Frame: Risk Averse"
// label define gain01 ///
// 0 "0 Deal B" 1 "1 Deal A"
// label values gain01 gain01 
// recast double gain01 

// *Loss Frame
// gen loss01 = loss
// recode loss01 (3=0) (4=1)
// label var loss01 ///
// "Loss Frame: Risk Seeking"
// label define loss01 ///
// 0 "0 Deal A" 1 "1 Deal B"
// label values loss01 loss01 
// recast double loss01 

// *Frame
// gen frame = .
// replace frame = 0 if gain01 == 0 | gain01 == 1
// replace frame = 1 if loss01 == 0 | loss01 == 1
// label var frame ///
// "Frame"
// label define frame ///
// 0 "Gain Frame" 1 "Loss Frame"
// label values frame frame 
// recast double frame 

// *Risky Choice 
// gen risky = .
// replace risky = 0 if gain01 == 1 | loss01 == 0
// replace risky = 1 if gain01 == 0 | loss01 == 1
// label define risky ///
// 0 "Certain Deal A" 1 "Risky Deal B"
// label var risky "Risky Choice"
// label values risky risky 
// recast double risky

********************************************************************************
********************************* Pre-Analysis ********************************* 
********************************************************************************

// *Drop observations based on failed attention check
// drop if (colorcheck == 0) 
	
********************************************************************************
********************************* Main Analysis ******************************** 
********************************************************************************

*Sample reference: Run this model first so other analyses are based on this sample
regress risky chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro 

*Items in Need for Chaos Scale (Table 2)
summarize chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7 if e(sample), detail
alpha chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7 if e(sample), item
factor chaos1 chaos2 chaos3 chaos4 chaos5 chaos6 chaos7 if e(sample), ipf

*Need for Chaos Scale
summarize chaos701 if e(sample), detail
tab chaos701 if e(sample)

*Distribution of Need for Chaos (Figure 2)
hist chaos7x if e(sample), percent 

*Correlates of NFChaos (Figure 3): If statement adjusts the sample so it includes only the respondents in the main results
regress chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro if risky == 0 | risky == 1
estimates store fig3 

coefplot fig3, drop(_cons)

*Test Prospect Theory 
tab gain01 if e(sample)
tab loss01 if e(sample)
summarize gain01 loss01 if e(sample)

*Main Results (Table 3)
logit risky frame if e(sample)

logit risky frame##c.chaos701 if e(sample)

logit risky frame##c.chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro 

*Predicted Probabilities (Figure 4)
margins, dydx(chaos701) at(frame=(0 1))
margins, at(chaos701=(0 .0238095 .0277778 .047619 .0714286 .0952381 .1190476 .1428571 .1666667 .1904762 .2142857 .2380952 .2619047 .2857143 .3095238 .3333333 .3571428 .3809524 .4047619 .4285714 .4523809 .4761905 .5 .5238095 .547619 .5714285 .5952381 .6190476 .6428571 .6666667 .6904762 .7142857 .7380952 .7619048 .7857143 .8095238 .8333333 .8571429 .8809524 .9047619 .9285715 .952381 .9761905 1) frame=(0 1))
marginsplot, legend(col(2) pos(6) size(vsmall) region(lstyle(none)))

*Post-estimation tests
margins frame, at(chaos701 = .4)
margins frame, at(chaos701 = .4) pwcompare(effects) 

margins frame, at(chaos701 = .5)
margins frame, at(chaos701 = .5) pwcompare(effects) 

margins frame, at(chaos701 = .6)
margins frame, at(chaos701 = .6) pwcompare(effects) 

margins frame, at(chaos701 = .7)
margins frame, at(chaos701 = .7) pwcompare(effects) 

margins frame, at(chaos701 = .8)
margins frame, at(chaos701 = .8) pwcompare(effects) 

margins frame, at(chaos701 = .9)
margins frame, at(chaos701 = .9) pwcompare(effects) 

margins frame, at(chaos701 = 1)
margins frame, at(chaos701 = 1) pwcompare(effects) 

********************************************************************************
**************************** Supplementary Material **************************** 
********************************************************************************

*Summary Statistics: If statement adjusts the sample so it includes only the respondents in the main results
summarize gain01 loss01 chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro risk01 if e(sample)

*Correlates of Need for Chaos (Model 1): If statement adjusts the sample so it includes only the respondents in the main results
regress chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro if risky == 0 | risky == 1

*Correlates of Need for Chaos (Model 2): If statement adjusts the sample so it includes only the respondents in the main results
regress chaos701 age01 race01 ethnicity01 gender01 income01 education01 religion01 pid701 polknow01 trustgovt01 interestdebt numeracysplit cognition01 closure01 author01 open conscient extra agree neuro risk01 if risky == 0 | risky == 1
